#include <signal.h>
#include <unistd.h>
#include <stdio.h>

static void sig_handler(int sig)
{
  printf("Ouch %d\n",sig);
}

int main(int argc, char *argv[])
{
  int j;
  if (signal(SIGINT, sig_handler) == SIG_ERR)
    printf("Failed to set sig_handler\n");
  for (j = 0; ;j++) {
    printf("%d\n",j);
    sleep(3);
  }
}
